<?php 
header('Content-Type:text/html;charset=gbk');
require_once("db_manage.php");
require_once '../bbs/include/common.inc.php';

$module = $_POST['module'];
$textsort = $_POST['textsort'];
$textid = $_POST['textid'];
$length = count($textsort);
$forum = $_POST['forum_transfer'];


if($module=='album'){
	$table = "pcd_album";
	$link = "";
}else if($module=='bbs_hot'){
	$table = "pcd_bbs_hot";
	$link = "manage_home_hot.php?forumsort=".$forum."";
}else if($module=='bbs_top'){
	$table = "pcd_bbs_top";
	$link = "manage_home_bbs_top.php";
}else if($module=='diary'){
	$table = "pcd_diary";
	$link = "manage_home_diary.php";
}else if($module=='favorite'){
	$table = "pcd_favorite";
	$link = "manage_home_favorite.php";
}else if($module=='flashhot'){
	$table = "pcd_flashhot";
	$link = "manage_home_flashhot.php";
}else if($module=='pic'){
	$table = "pcd_pic";
	$link = "manage_home_pic.php";
}else if($module=='food'){
	$table = "pcd_selectedfood";
	$link = "manage_home_information.php?forumsort=food";	
}else if($module=='travel'){
	$table = "pcd_selectedtravel";
	$link = "manage_home_information.php?forumsort=travel";	
}else if($module=='subject'){
	$table = "pcd_subject";
	$link = "manage_home_special.php";
}else if($module=='suggest'){
	$table = "pcd_suggest";
	$link = "manage_home_fspecial.php";
}

for($i=0;$i<$length;$i++){
	update_textsort($table, $textid[$i], $textsort[$i]);	
}
echo "<script>location.href='".$link."';</script>";
?>